(function() {
	window.tab = function(f) {
		var d = document.getElementById(f);
		var b = d.children[0];
		var e = b.children;
		var a = d.getElementsByTagName("ol");
		for (var c = 0; c < e.length; c++) {
			e[c].index = c;
			e[c].onmouseover = function() {
				for (var g = 0; g < e.length; g++) {
					e[g].className = "";
					a[g].style.display = "none";
				}
				this.className = "a_out";
				a[this.index].style.display = "block";
			};
		}
	};
	window.showList = function(g) {
		var c = document.getElementById(g);
		var b = c.children;
		var e = c.parentNode;
		c.innerHTML += c.innerHTML;
		c.style.height = (b[0].offsetHeight + 28) * b.length + "px";
		var a = c.offsetHeight / 2;
		c.style.top = -a + 5 + "px";
		console.log(b[0].offsetHeight + "|" + a);
		function d() {
			if (c.offsetTop >= 5) {
				c.style.top = -a + 5 + "px";
			} else {
				startMove(c, {
				top : c.offsetTop + 222
				}, {
				type : "ease-out"
				});
			}
		}

		var f = setInterval(d, 3000);
		e.onmouseover = function() {
			clearInterval(f);
		};
		e.onmouseout = function() {
			f = setInterval(d, 3000);
		};
	};
	window.slider = function(c) {
		var g = document.getElementById(c);
		var k = g.children[0].children[0].children;
		var a = g.children[0].children[1].children;
		var j = 0;
		for (var e = 0; e < k.length; e++) {
			k[e].index = e;
			k[e].onmouseover = function() {
				j = this.index;
				d();
			};
		}
		function d() {
			for (var l = 0; l < k.length; l++) {
				k[l].className = "";
				a[l].style.zIndex = 0;
				startMove(a[l], {
					opacity : 0
				});
			}
			k[j].className = "active";
			a[j].style.zIndex = 10;
			startMove(a[j], {
				opacity : 100
			});
		}

		function f() {
			j++;
			if (j == k.length) {
				j = 0;
			}
			d();
		}

		var b = setInterval(f, 5000);
		g.onmouseover = function() {
			clearInterval(b);
		};
		g.onmouseout = function() {
			b = setInterval(f, 5000);
		};
		function h(l, i) {
			return (l.currentStyle || getComputedStyle(l, false))[i];
		}


		window.startMove = function(q, o, m) {
			m = m || {};
			m.type = m.type || "ease-out";
			m.time = m.time || 700;
			clearInterval(q.timer);
			var s = {};
			var i = {};
			var p = Math.floor(m.time / 30);
			for (var l in o) {
				if (l == "opacity") {
					s[l] = Math.round(parseFloat(h(q, l)) * 100);
				} else {
					s[l] = parseInt(h(q, l));
				}
				if (isNaN(s[l])) {
					switch (l) {
					case "opacity":
						s[l] = 100;
						break;
					case "left":
						s[l] = 0;
						break;
					case "top":
						s[l] = 0;
						break;
					case "width":
						s[l] = q.offsetWidth;
						break;
					case "marginLeft":
						s[l] = 0;
						break;
					case "borderWidth":
						s[l] = 0;
						break;
					}
				}
				i[l] = o[l] - s[l];
			}
			var r = 0;
			q.timer = setInterval(function() {
				r++;
				for (var t in o) {
					switch (m.type) {
					case "linear":
						var n = r / p;
						var u = s[t] + i[t] * n;
						break;
					case "ease-in":
						var n = r / p;
						var u = s[t] + i[t] * (n * n * n);
						break;
					case "ease-out":
						var n = 1 - r / p;
						var u = s[t] + i[t] * (1 - n * n * n);
						break;
					}
					if (t == "opacity") {
						q.style.opacity = u / 100;
						q.style.filter = "alpha(opacity:" + u + ")";
					} else {
						q.style[t] = u + "px";
					}
				}
				if (r == p) {
					clearInterval(q.timer);
					m.end && m.end();
				}
			}, 30);
		};
	};
})(); 